<%--
  Created by IntelliJ IDEA.
  User: YKMZ
  Date: 2022/9/23
  Time: 11:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <%-- 1. 引入jquery--%>
    <script src="webjars/jquery/3.6.1/dist/jquery.min.js"></script>
    <%-- 2. 引入bootstrap的css样式--%>
    <link rel="stylesheet" href="webjars/bootstrap/3.4.1/dist/css/bootstrap.min.css">
    <%-- 3. 引入bootstrap的js样式--%>
    <script src="webjars/bootstrap/3.4.1/dist/js/bootstrap.min.js"></script>
    <title>购物车</title>
</head>
<body>
    <div class="container">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title">
                    <h3>购物车列表</h3>
                </h3>
            </div>
            <table class="table table-bordered table-hover">
                <tr>
                    <td>甜点ID</td>
                    <td>甜点名称</td>
                    <td>单价</td>
                    <td>购买数量</td>
                    <td>操作</td>
                </tr>
                <c:forEach items="${cart.map}" var="d" >
                <tr>
                    <td>${d.value.dessert.did}</td>
                    <td>${d.value.dessert.dname}</td>
                    <td>${d.value.dessert.price}</td>
                    <td>${d.value.num}</td>
                    <td>
                        <a href="/cart?cmd=remove&did=${d.value.dessert.did}" class="btn btn-danger bt-sm">移除</a>
                    </td>
                </tr>
                </c:forEach>
            </table>
            <div class="panel-footer text-right">
                <a href="/index.jsp" class="btn btn-success btn-sm">继续挑选</a>
                百年智2022.
            </div>
        </div>
    </div>
</body>
</html>
